package StudentManagement;

public class StudentSystem {
    public static void main(String[] args) {
        // 创建学生对象
        Student stu1 = new Student("2025005", "孙七", "大数据技术");
        stu1.setScore(85);

        Student stu2 = new Student("2025006", "周八", "软件技术");
        stu2.setScore(92);

        Student stu3 = new Student("2025007", "吴九", "云计算");
        stu3.setScore(78);

        stu3.setScore(185); // 测试不合法成绩

        // 存储到数组
        Student[] students = {stu1, stu2, stu3};

        // 遍历输出并计算平均分
        double total = 0;
        System.out.println("学生信息列表：");
        for (Student s : students) {
            s.showInfo();
            total += s.getScore();
        }
        System.out.println("平均分：" + (total / students.length));
    }
}